﻿
@{
    ViewBag.Title = "运营商审核";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
    var GenImg1 = ViewBag.GenImg1;
    var AnnounceStatus = ViewBag.AnnounceStatus;
    var AnnounceCode = ViewBag.AnnounceCode;

}
<link rel="stylesheet" href="~/Content/css/easyui.css" />
<link rel="stylesheet" href="~/Content/css/weui.min.css">
<link rel="stylesheet" href="~/Content/css/jquery-weui.min.css">
<script src="~/Content/script/jquery-1.11.0.min.js"></script>
<script src="~/Content/script/jquery-weui-1.2.1.min.js"></script>
<script src="~/Content/script/jquery.easyui.min.js"></script>
<script src="~/Content/script/jquery.easyui-1.4.3.min.js"></script>

<div class="weui-cells weui-cells_form" style="bottom: 20px;">
    <div class="weui-cells__title" style="height:1.2rem">审核备注</div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__bd">
                <textarea class="weui-textarea" id="AuditRemark" style="height:6.25rem" placeholder="请输入文本" rows="3"></textarea>
            </div>
        </div>
    </div>


</div>
<div class="weui-cells__tips">*信息可选填</div>

<div class="ui-btn-wrap" id="footer">
    <div class="button_sp_area">

        <a href="javascript:;" id="AnnPass" class="weui-btn weui-btn_mini weui-btn_primary" style="width:30%;">同意</a>
        <a href="javascript:;" id="AnnNoPass" class="weui-btn weui-btn_mini weui-btn_warn" style="width:30%;">否决</a>
        <a href="javascript:;" id="Clear" class="weui-btn weui-btn_mini weui-btn_default " style="width:30%;">取消</a>
    </div>
</div>

<script>

    //获取Detail传过来的参数
    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }



    //审核方法
    function AnnPassNoPass(state) {
        var GenImg1 = "@GenImg1";
        var AnnounceStatus = state;
        var AuditRemark = $("#AuditRemark").val();

        $.ajax({
            url: "/api/Annouce/Audit_AnnounceTeleAudit",
            type: "get",
            data: { GenImg1: GenImg1, AnnounceStatus: AnnounceStatus, AuditRemark: AuditRemark },
            beforeSend: function () {
                $.showLoading("提交中...");
            },
            success: function (data) {
                //console.log(data);
                data = data.Data
                if (data.code == 1) {
                    //   alert(data.result);
                    $.toast(data.result);
                    setTimeout(function () {
                        location.href = "/AnnounceTeleAudit/Detail?annouceCode=@AnnounceCode&Id=@GenImg1";
                        //   location.href = "/AnnouceList/Detail?annouceCode=" + annouceCode + "";
                    }, 1 * 1000);
                    //$.alert(data.result, "提示！");
                    //location.href = "/AnnouceAudit/Index";
                }
            },
            error: function () {
                $.alert("error :请求出错", "提示！");
                location.href = "/AnnounceTeleAudit/Detail?annouceCode=@AnnounceCode&Id=@GenImg1";
                //alert("error :请求出错")
            }
        })
    }



    $("#AnnPass").click(function () {

        $.confirm("确认审核通过？", "提示", function () {
            AnnPassNoPass(30)
        })
    })
    $("#AnnNoPass").click(function () {

        $.confirm("确认审核不通过？", "提示", function () {
            AnnPassNoPass(31)
        })
    })

    $("#Clear").click(function () {
        var AnnounceCode = GetRequest()['AnnounceCode'];//拿到参数annouceCode
        location.href = "/AnnounceTeleAudit/Detail?annouceCode=@AnnounceCode&Id=@GenImg1";

    })

</script>